////https://www.luogu.com.cn/problem/P1464
//
//#include<iostream>
//#include<cstring>
//using namespace std;
//typedef long long ll;
//ll a, b, c;
//ll x[30][30][30];
//
//ll dfs(ll a, ll b, ll c)
//{
//	if (a <= 0 || b <= 0 || c <= 0) return 1;
//	if (a > 20 || b > 20 || c > 20) return dfs(20, 20, 20);
//	if (x[a][b][c]) return x[a][b][c];
//
//	if (a < b && b < c) return x[a][b][c] = dfs(a, b, c - 1) + dfs(a, b - 1, c - 1) - dfs(a, b - 1, c);
//	else  return x[a][b][c] = dfs(a - 1, b, c) + dfs(a - 1, b - 1, c) + dfs(a - 1, b, c - 1) - dfs(a - 1, b - 1, c - 1);
//}
//
//int main()
//{
//	while (cin >> a >> b >> c)
//	{
//		if (a == b && b == c && a == -1) break;
//		printf("w(%lld, %lld, %lld) = %lld\n", a, b, c, dfs(a, b, c));
//	}
//	return 0; 
//}